const { app, BrowserWindow } = require('electron');
const { toWatchIng } = require("./mainThread/watching");
const path = require("path");
// try {
//     require('electron-reloader')(module,{});
// } catch (_) {}
const createWindow = async () => {
    // await getChanDaoData({
    //     cookie_zentaosid: 'rtnljuu7rtbatqrpvfdna64u2cfsbia030doib4kcish9k3cshe83tpdkssjj6ikfrbln6gs',
    //     importType: 1
    // })
    const win = new BrowserWindow({
        width: 80,
        height: 25,
        alwaysOnTop: true,
        x: 80,
        y: 30,
        title: "禅道伴侣",
        // 不显示工具栏
        // autoHideMenuBar:false,
        // backgroundColor:"rgba(255,255,255,0.6)",
        useContentSize: true,
        frame: false,
        webPreferences: {
            preload: path.join(__dirname, 'mainThread', 'preload.js')
        },
        icon: '/images/icon2'
    })
    // win.webContents.openDevTools()
    toWatchIng(win)
    win.loadURL(path.join(__dirname, 'render', 'index.html'));
}
app.whenReady().then(() => {
    createWindow();
    app.on('activate', () => {
        if (BrowserWindow.getAllWindows().length === 0) createWindow()
    })
})